UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RMjx06d2qkQmmdOc/8UCRHZpCSzVmGdSElvQQTYZDLM='
WHERE
key_id = '28f8c4967be38572c4f166e574766497b4f143acc8d90de89326cd1caa1af19c'
AND (
token = 'RMjx06d2qkQmmdOc/8UCRHZpCSzVmGdSElvQQTYZDLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)