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