UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'urkZy5SqOclGYmTXyXk0FSDL77WFqTsn6R4IyhP7VEU='
WHERE
key_id = '923cacc8068dc0fd3b5695a7d1b160b5db85a5e7850bc2103090ce6576f42b74'
AND (
token = 'urkZy5SqOclGYmTXyXk0FSDL77WFqTsn6R4IyhP7VEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)