UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W/IkSH7RlYXCQ9xV72a/CvZSBEMw+B6sTzMI/h3iCsc='
WHERE
key_id = '556e4fd6fb34a3d6930fd05a2eded9cda728668bf4efa9bb2430ef33c4e90eba'
AND (
token = 'W/IkSH7RlYXCQ9xV72a/CvZSBEMw+B6sTzMI/h3iCsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)