UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3nlty+LnqisJhF8HQH73kpKAPOel116PMMAQjBt4Z5Q='
WHERE
key_id = 'f1955ecd71cac349dbd264a0d685c11434e68a76b75a9b803aac13cba046c547'
AND (
token = '3nlty+LnqisJhF8HQH73kpKAPOel116PMMAQjBt4Z5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)