UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zolTrZ4sfqlup9qHqbpWA6Z0pM6BHmEnfRGrAdaw8mI='
WHERE
key_id = '3a5d161b6c499875f63e99fbd190bb1c7811cce932d1c4a30df202112aec8bfa'
AND (
token = 'zolTrZ4sfqlup9qHqbpWA6Z0pM6BHmEnfRGrAdaw8mI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)