UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L6RCUi2mNWWf+GzSUVOgnhdYxbcsPQCSpFZi3bZOW88='
WHERE
key_id = '2aaac3516bb85fb6f94ff294931e5c72606cc73c6bf3ac39a51e996db5970d21'
AND (
token = 'L6RCUi2mNWWf+GzSUVOgnhdYxbcsPQCSpFZi3bZOW88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)