UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7cqpNR0Oq4LVL3m91zs9l2SBq+d5uM60ZI3RNYnekSw='
WHERE
key_id = '1cf9a2fdc457b53b5b8efaca8b16b70bc7f2aca04960f2c6df6954a66d1a88f9'
AND (
token = '7cqpNR0Oq4LVL3m91zs9l2SBq+d5uM60ZI3RNYnekSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)