UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4hyB535Udkc4bpoVtcY7O5DcV7Um3RpR2jC2R50pFik='
WHERE
key_id = '8cd0026bc84a952153e79bb47cb726749b0ca4c8e4f3c8ccee09742b4bfe5e27'
AND (
token = '4hyB535Udkc4bpoVtcY7O5DcV7Um3RpR2jC2R50pFik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)