UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tHmepu+3GlVoZDsr61df9irabqjGxf9557VcOwGcczQ='
WHERE
key_id = 'b358abecfcafebb0af2c9d5e87f3890ca63b42a63c0ebf0a7c7775db41bededc'
AND (
token = 'tHmepu+3GlVoZDsr61df9irabqjGxf9557VcOwGcczQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)