UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XwZR+4zh6zzacY2VIJxduRatNYf2kAukC/amgNdoOlw='
WHERE
key_id = '57ff58faf5ec0962a8f4d3a1e7daf9ee428272fea49c81a74b27c85e3317fcdb'
AND (
token = 'XwZR+4zh6zzacY2VIJxduRatNYf2kAukC/amgNdoOlw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)