UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1JzdKpBeYxffAVd3K2uRCuWnGrBYE1kR/FGeLWqwmco='
WHERE
key_id = 'a1893f2f3023dc63f9348b03605c6ce02d4da2f2bfd736071a61893ac5ea67ad'
AND (
token = '1JzdKpBeYxffAVd3K2uRCuWnGrBYE1kR/FGeLWqwmco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)