UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PZog+mC1L9uRMLkiBAeMy2rpTnJgOedq7JnB5lttgP0='
WHERE
key_id = '6d835d788ab3591d2043082282e896c5e1709af0a5eedf8e613cba171a647a85'
AND (
token = 'PZog+mC1L9uRMLkiBAeMy2rpTnJgOedq7JnB5lttgP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)