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