UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PsM/LkCOVijKmZxW3ySJC3R5juwb1SefrbTkdO9+n9Y='
WHERE
key_id = '18cca164030f7ba47304b52dfd21c6662dbe3a256701576c2927db545ded7736'
AND (
token = 'PsM/LkCOVijKmZxW3ySJC3R5juwb1SefrbTkdO9+n9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)