UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6CUBcOgjPcFplc2ZetgSB5gbu6A4FiJH4OtAKC4mmGA='
WHERE
key_id = '0cc9cbe557894458cc3bdc0bdc722b241f2ac221b3fce3e820255540e8b0f0a7'
AND (
token = '6CUBcOgjPcFplc2ZetgSB5gbu6A4FiJH4OtAKC4mmGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)