UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o0LI7eCLi4p5Urk/KVqsG+vvc0+trDGQpOsGCXLd2Lo='
WHERE
key_id = 'eb51b9604084677a7d59a37d054717f3f408700e90f184871b6355b75007cdf9'
AND (
token = 'o0LI7eCLi4p5Urk/KVqsG+vvc0+trDGQpOsGCXLd2Lo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)