UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XeV25E4Z1sXArMbAK3s3pjYxtuGFG2ijNERuDorHVs='
WHERE
key_id = '295c09149c859585a5a164f6ad9567fc77b72080f2673933ac673e8a6b1b8cae'
AND (
token = '1XeV25E4Z1sXArMbAK3s3pjYxtuGFG2ijNERuDorHVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)