UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2h7Da4czI7i5e+MNiTbNxJf8UlNzU68prvobo8azKrk='
WHERE
key_id = '9df90b0d762e7fecc0d72149f4b413969d1537413144da9ff5558dc7b926f27b'
AND (
token = '2h7Da4czI7i5e+MNiTbNxJf8UlNzU68prvobo8azKrk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)