UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nzx3XdR4efuapvnIO8rgZEYdO8iRODAFvxWoWvzuyzQ='
WHERE
key_id = 'c927503a5befa2e1307b5dfdaa8110a2a9262df83ac2bf5a9c9255f1ec9717d1'
AND (
token = 'nzx3XdR4efuapvnIO8rgZEYdO8iRODAFvxWoWvzuyzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)