UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bwLmtL2T/bKnMfu+zD04WTzvej4YUHVr77A0VLHKhOE='
WHERE
key_id = '78eb517553618eab6ebf74b6590b29af1da9cdcac46aacc23062d07b995757e5'
AND (
token = 'bwLmtL2T/bKnMfu+zD04WTzvej4YUHVr77A0VLHKhOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)