UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yGLVZ8IzVBRx4nz4e/WCutXfGdKg4m0KghwDygKXZgg='
WHERE
key_id = '5eded5d03f388e3fe783db495db9f090dab6f113b58f2652f5e1d1feb6f4aa06'
AND (
token = 'yGLVZ8IzVBRx4nz4e/WCutXfGdKg4m0KghwDygKXZgg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)