UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Q5r+T+aRL8UGqqP9W7u0GUNke6S6NuFWruf5wSdhKI=' 
WHERE 
  key_id = 'b23653294248210ab2454a66cbad01da85a55acde52bcc3ca65dfed2c511292f' 
  AND (
    token = '3Q5r+T+aRL8UGqqP9W7u0GUNke6S6NuFWruf5wSdhKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027