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