UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EFfx+ys1TyXTEcr4WmOa4v+oaBDsZtIX7lkcuEHaSGA='
WHERE
key_id = '247d73caf72fc6c053643c12c1e1aa5be6276345ae87413e77b0efb228813a45'
AND (
token = 'EFfx+ys1TyXTEcr4WmOa4v+oaBDsZtIX7lkcuEHaSGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)