UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9mzWSwMMPrFA1stWNDbv4+xbVsEj6I6UCLgK0iN04kk='
WHERE
key_id = '28b7ba2db980e0780299274c2af121da90dc11b03c1131db1b86ea9257aaad8e'
AND (
token = '9mzWSwMMPrFA1stWNDbv4+xbVsEj6I6UCLgK0iN04kk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)