UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wIgaOOgeqeyg/dJ3WA4aKb1/PW/m//JlaC7e+IsBr6o='
WHERE
key_id = '05ea7499fd284da22d7ccee3ed1a14f5629df6a12d611d3518d584178eb9373c'
AND (
token = 'wIgaOOgeqeyg/dJ3WA4aKb1/PW/m//JlaC7e+IsBr6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)