UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p4s6P3CtfhDiUnibFi+0TF91dHujz3p9BlvfrGcTods='
WHERE
key_id = 'b30518297e02521ee6394aa5dcc435b41d0b574e334d72d766674e0158792e42'
AND (
token = 'p4s6P3CtfhDiUnibFi+0TF91dHujz3p9BlvfrGcTods='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)