UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EmxOb78+N+33qRsqxsskAQ1RaOWQPoeegUWia+DGfN0='
WHERE
key_id = '3060dfa0da3361564d7b280f82558e1339e34167384d37dc57ae7c59112009a0'
AND (
token = 'EmxOb78+N+33qRsqxsskAQ1RaOWQPoeegUWia+DGfN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)