UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kFni4Swsi55OKU/YfrxwyTuOtJ9TQgbuOKvzbuOpPoA='
WHERE
key_id = '948a5893203da0867d4699525a44232dbae9193a9adb453eacb6997bfe76accf'
AND (
token = 'kFni4Swsi55OKU/YfrxwyTuOtJ9TQgbuOKvzbuOpPoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)