UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dCkIs1c5s8hagxLv/Bl0oO8UC9C4TuYVMC1ljMuxwnc='
WHERE
key_id = '78997046d0d5b6ab8a97bc5b83698817a55bbcf779c0c16358e1e65bc52542b6'
AND (
token = 'dCkIs1c5s8hagxLv/Bl0oO8UC9C4TuYVMC1ljMuxwnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)