UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G2aqjvB5nRwiff1F1KJuQzvJ0O+91jjGnF4SGQHM3pk='
WHERE
key_id = 'ebb5664c90586b05a11869daa6ee5bc230874cfeae1876d05ab73f02aad12175'
AND (
token = 'G2aqjvB5nRwiff1F1KJuQzvJ0O+91jjGnF4SGQHM3pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)