UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dL2mp4BWijinoSm557ONnLMm/Le3FYaEuhZalrKj5PQ='
WHERE
key_id = 'fd789f9fdcb9f8c2efa36589986329c48919714ba54dc362a7c0582a5ce244c4'
AND (
token = 'dL2mp4BWijinoSm557ONnLMm/Le3FYaEuhZalrKj5PQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)