UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wfxs2S3E6t5C4zUm0L/X1x101RS44N6iUpLKO8tU4sA='
WHERE
key_id = '8adaefb65cf64ed8ea6e48a0940deb6df12af076780edaf63de318c532f2607c'
AND (
token = 'wfxs2S3E6t5C4zUm0L/X1x101RS44N6iUpLKO8tU4sA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)