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